package demo.gs.plugins;


import com.android.build.gradle.AppExtension;
import com.android.build.gradle.AppPlugin;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

/**
 * <br>createBy Gw
 * <br>createTime: 2021/6/28 18:44
 */
public class ASMPlugin implements Plugin<Project> {

	@Override
	public void apply(Project project) {
		project.getLogger().quiet("AMS-PLUGIN: start");

		boolean isApp = project.getPlugins().hasPlugin(AppPlugin.class);
		if(!isApp) return;

		project.getLogger().quiet("AMS-PLUGIN: process");

		AppExtension android = project.getExtensions().getByType(AppExtension.class);
		android.registerTransform(new ASMTransform(project));
	}
}